const action = require("../action");

module.exports = {
    'GET /studio/:studioId/service/:serviceId': async (ctx, next) => {
        let studioId = ctx.params.studioId;
        let serviceId = ctx.params.serviceId;

        let studioData = await action.studio.getStudioPageData(studioId);
        let ServiceData = await action.service.getServicePageData(serviceId);

        ctx.render('service.html', {
            "ui": {
                "studioTab": {
                    "state": "MAIN",
                    "url": {
                        "main": "/studio/" + studioId + "/",
                        "service": "/studio/" + studioId + "/service-list"
                    }
                },
                "title": ServiceData.title,
                "env": process.env.NODE_ENV,
                "studioBanner": studioData.studioBanner,
            },
            "servicePrice": ServiceData.price,
            "serviceTitle": ServiceData.title,
            "serviceTitle2": ServiceData.title2,

            "serviceSliderPhotos": ServiceData.serviceSliderPhotos,
            "serviceContent": ServiceData.serviceContent
        });
    }
};

